import type { AddressItem, Logistics, OrderDetail, OrderPre } from "@/types/order";
import { request } from "@/utils/request";

// 预支付
export const getMedicalOrderPre = (params:{
  prescriptionId:string
}) =>request<OrderPre>('/patient/medicine/order/pre','get',params)

// 收货信息
export const getAddressList = ()=>request<AddressItem[]>('patient/order/address')

export const createMedicalOrder = (data:{
  id:string,
  addressId:string,
  couponId?:string
}) => request<{id:string}>('patient/medicine/order','post',data)

// 获取订单详情
export const getMedicalOrderDetail = (id:string)=>request<OrderDetail>(`patient/medicine/order/detail/${id}`)

// 获取订单的物流信息
export const getMedicalOrderLogistics = (id:string)=>request<Logistics>(`patient/order/${id}/logistics`)
